package sch.frog.behavioral.strategy;

public class StrategyContext {

    private IStrategy strategy;

    public StrategyContext(IStrategy strategy) {
        this.strategy = strategy;
    }

    private int value;

    public StrategyContext(int value){
        if(value > 0){
            strategy = new ConcreteStrategyA();
        }else{
            strategy = new ConcreteStrategyB();
        }
    }

    public void contextMethod(){
        strategy.algorithmMethod();
    }
}
